<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
	<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
	<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
	<link rel="stylesheet" href="${staticServer}/css/consultant_client.css" />
	<link rel="stylesheet" href="${staticServer}/css/system_client_allot.css" />
	<link rel="stylesheet" href="${staticServer}/css/consultant_client_tracking.css" />
	<script src="${staticServer}/inc/js/jquery.js"></script>
	<script src="${staticServer}/inc/js/pageset.js"></script>
	<script src="${staticServer}/inc/js/city.js"></script>
	<script src="${staticServer}/inc/js/submitter.js"></script>
	<script src="${staticServer}/js/web/system_client_allot.js?2.4"></script>
	<style type="text/css">
#statelist label {
	display: block;
	float: left;
	width: 120px;
	height:200px;
}
table tr[class=fields] {
    background: #EFE5EB;
}
table tr[class=fields] th {
    padding-left: 0;
}
table tr[class=fields] th {
    height: 40px;
    line-height: 40px;
    padding-left: 20px;
    background: #EFE5EB;
}
table th,table td {
    padding-left: 10px;
    padding-right: 10px;
    border: 1px solid #D0D0D0;
}
table tr.even_row {
    background: #fcfcfc;
}
table th, table td {
    padding-left: 10px;
    padding-right: 10px;
    border: 1px solid #D0D0D0;
}
table tr>th {
    color: #999;
    font-size: 15px;
    font-weight: bold;
    text-align: right;
}
.caption {
    color: #bbb;
    font-weight: normal;
    font-size: 12px;
    font-style: italic;
}
#statelist label {
    display: block;
    float: left;
    width: 120px;
}
table tr.odd_row {
    background: #f6f6f6;
}
.caption {
    color: #bbb;
    font-weight: normal;
    font-size: 12px;
    font-style: italic;
}
.am-close {
    display: inline-block;
    float: right;
    text-align: center;
    width: 24px;
    font-size: 28px;
    font-weight: 700;
    line-height: 35px;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    -webkit-transition: all .3s;
    transition: all .3s;
}

.trackinglst ul li {
    list-style: none;
    border: 1px solid #c7c8c9;
    background: #f9f9f9;
    padding: 5px 10px 5px 10px;
    margin: 5px 0 5px;
    -moz-border-radius: 8px;
    -khtml-border-radius: 8px;
    -webkit-border-radius: 8px;
    border-radius: 8px;

</style>
	<script>
var contextPath='${contextPath}';
		
var addFloat = function(keyname){
	$("#keyname").val(keyname);
	$("#__DIV_CLIENT_SELECTOR_MASK").show();
	$("#__DIV_CLIENT_SELECTOR").show();
	
}

var addFloat = function(keyname){
	$.post("${contextPath}/index/get_client_follow.json", {
		"keyname":keyname
	}, function(ms) {
		var list = ms.list;
		var stulist = ms.stuList;
		var objHtml = "";
		var h=" ";
		var t=" ";
		var m=" ";
		var l=" ";
		$("#tracking").html(" ");
		$("#stuname").html(" ");
		$("#stusex").html(" ");
		$("#stuage").html("");
		$("#stufeature").html(" ");
		if(list!=null && stulist!=null){
			var j=0;
			for(var i=0;i<list.length;i++){
				var state = "";
				if(list[i].state=="" || list[i].state==null){
					state = '<a class="stateitem caption">无变化</a>';
				}else{
					state = '<a class="stateitem">'+list[i].state+'</a>';
				}
				if(list[i].state2=="" || list[i].state2==null){
					state2 = '';
				}else{
					state2 = '<a class="stateitem">'+list[i].state2+'</a>';
				}
				if(list[i].state3=="" || list[i].state3==null){
					state3 = '';
				}else{
					state3 = '<a class="stateitem">'+list[i].state3+'</a>';
				}
				objHtml += '<ul>'+
	            			'<li>'+
	            				'<p class="trackingtitle" style="display: block;">第 '+(++j)+' 次跟踪记录<em class="caption">（负责人：'+list[i].nickname+'　日期：2016-07-18 13:40:06）</em><a class="btnHidden"></a></p>'+
	            				'<p class="trackingstate" style="display: block;"><b>客户状态</b><span>'+state+state2+state3+'</span></p>'+
	            				'<p style="display: block;"><b>备注情况</b></p>'+
	            				'<div class="content" style="display: block;">'+list[i].remark+'</div>'+
	            			'</li>'+
	            		'</ul>'
			}
			for(var i=0;i<stulist.length;i++){
				h +='<p class="stuname">'+stulist[i].nickname+'</p>'
				t +='<p class="stusex">'+stulist[i].sex+'</p>'
				m +='<p class="stuage">'+stulist[i].age+'</p>' 
				l +='<p class="stufeature">'+stulist[i].feature+'</p>'  
			}   
			$("#stuname").append(h);
			$("#stusex").append(t);
			$("#stuage").append(m);
			$("#stufeature").append(l);
			$("#tracking").append(objHtml);
			$("#__DIV_CLIENT_SELECTOR_MASK").show();
			$("#__DIV_CLIENT_SELECTOR").show();
		}
	});
}

var quxiao = function(){
	$("#__DIV_CLIENT_SELECTOR_MASK").hide();
	$("#__DIV_CLIENT_SELECTOR").hide();
}


function querys_city(city){
	var html = '<option value="">-- 请选择目标 --'+'</option>';
	$.post("${contextPath}/index/system_city.json", {
		"city":city
	}, function(ms) {
		var theSelect=document.all.target;
		for(var i=theSelect.options.length-1;i>=0;i--){
			theSelect.options.remove(i);
		}
		var ulist = ms.uList;
		var user1List = ms.uses1List;
		for(var h=0;h<ulist.length;h++){
			html +='<option value="'+ulist[h].username+'">'+ulist[h].nickname+'（'+ulist[h].regions+'-'+ulist[h].departments+'-'+ulist[h].job+'）</option>';
		}
		for(var h=0;h<user1List.length;h++){
			html +='<option value="'+user1List[h].username+'">'+user1List[h].nickname+'（'+user1List[h].regions+'-'+user1List[h].departments+'-'+user1List[h].job+'）</option>';
		}
		
		$("#target").append(html);
		
	});
}	
$(document).ready(function(){
var bh =$(window).height()/2;
var bw =$("body").width()/2;
var h = $("#__DIV_CLIENT_SELECTOR").height()/2;
var w =$("#__DIV_CLIENT_SELECTOR").width()/2;
var mh = bh-h-30;
var mw = bw-w;
  $("#__DIV_CLIENT_SELECTOR").css({"top":mh,"left":mw,"position":"fixed"});
  $("#__DIV_CLIENT_SELECTOR_MASK").css("position","fixed");
});



	</script>
</head>
<body>
<input type="hidden" id="type" value="${type}">
<div id="__DIV_CLIENT_SELECTOR" style="overflow: auto;position: absolute; z-index: 9900; top:200px;left:304px;display: none;width: 900px;height: 500px; background-color:#FFF;">
    	<table id="reset" style="width: inherit;"><tr class="fields">
				<th colspan="2">学员基本情况<a href="#"  onclick="quxiao()" class="am-close">&times;</a></th>
			</tr>
			<tbody>
			<tr class="even1_row">
				<th width="25%" style="text-align:center;">学员姓名
				</th>
				<td width="75%" id="stuname">
				</td>
			</tr>
			<tr class="even2_row">
				<th width="25%" style="text-align:center;">学生性别
				</th>
				<td width="75%" id="stusex">
				</td>
			</tr>
			<tr class="even3_row">
				<th width="25%" style="text-align:center;">学生年龄
				</th>
				<td width="75%" id="stuage">
				</td>
			</tr>
			<tr class="even4_row">
				<th width="25%" style="text-align:center;">学生特征
				</th>
				<td width="75%" id="stufeature">
				</td>
			</tr>
			<tr class="fields">
				<th colspan="2" style="padding-right:32px;">追踪情况</th>
			</tr>
			<tr class="even_row">
				<td colspan="4" class="trackinglst" id="tracking">
				</td>
			</tr>
			<tbody>
		</table>
	
		
</div>

<div id="__DIV_CLIENT_SELECTOR_MASK" style="display: none; position: absolute; z-index: 8999; opacity: 0.2; width: 2088px; height: 1925px; left: 0px; top: 0px; background-color: rgb(0, 0, 0);"></div>
	
</div>

	<input type="hidden" id="user_name" value="<#if webutil.getCookieUser()??>${webutil.getCookieUser().nickname}</#if>">
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>资源统计管理</li>
			<li>&gt;</li>
			<li class="current">客户资源分配</li>
		</ul>
	</div>
	<div id="caption">
		<ul>
			<li><span class="title">操作提示：</span></li>
			<li>Ctrl+Enter 提交</li>
		</ul>
	</div>
	<div id="container">
		<div id="title"></div>
		<table id="tbl_client">
			<tr class="fields">
				<th colspan="2">客户搜索和选择</th>
			</tr>
			<input type="hidden" id="username" value="" />
			<tr>
				<th>客户来源渠道</th>
				<td>
					<select id="source">
					<option value="">-- 请选择渠道 --</option>
					<#if souList??>
						<#list souList as list>
							<option value="${list.keyname}">${list.name}</option>
						</#list>
					</#if>
						<option value="cru0943rdrf2" title="用于标记无效资源">未知</option>
					</select>
				</td>
			</tr>
			<tr>
				<th>客户意向</th>
				<td>
					<select id="intention">
						<option value="">--请选择--</option>
	                	<option value="A">A</option>
	                	<option value="B">B</option>
	                	<option value="C">C</option>
	                	<option value="D">D</option>
	                </select>
				</td>
			</tr>
			<tr>
				<th>客户最后状态</th>
				<td>
					<select id="state">
						<option value="">-- 请选择状态 --</option>
						<option value="已测评">已测评</option>
						<option value="已预约">已预约</option>
						<option value="已缴费">已缴费</option>
						<option value="未出现">未出现</option>
						<option value="无">无</option>
					</select>
				</td>
			</tr>
			<tr rel="hide">
				<th width="25%">所在地</th>
				<td><select id="province">
					</select> <em class="caption">（省份）</em> <select id="city">
					</select> <em class="caption">（城市）</em></td>
			</tr>
			<tr>
				<th>联系方式</th>
				<td><label for="phone">联系电话：</label> <input type="text" id="phone" size="15" placeholder="客户联系电话" /> <label for="qq">ＱＱ号码：</label>
					<input type="text" id="qq" size="15" placeholder="QQ号码" /> 
					<label for="email">邮箱：</label> <input type="text" id="email" size="28" placeholder="Email地址" /></td>
			</tr>
			<tr rel="hide">
				<th>客户姓名/称呼</th>
				<td><input id="nickname" size="50" /></td>
			</tr>
			<tr rel="hide">
				<th>客户搜索结果
					<p class="caption">筛选出的客户资源会列出在此，并可多选</p>
					<div style="padding: 5px;">
						<input type="checkbox" name="controlAll" style="controlAll" id="controlAll"/>全选<br>
					</div>
				</th>
				<td id="clientlst">
					<div>
						<label>结果中搜索：</label><input id="nickname_key" placeholder="客户姓名" /><em class="caption">（符合条件的结果将高亮显示）</em>
					</div>
					<ul>
					</ul>
				</td>
			</tr>
		</table>
		<table id="tbl_target">
			<tr class="fields">
				<th colspan="2">分配目标选择</th>
			</tr>
			<tr>
				<th width="25%">目标咨询师</th>
				<td width="75%">
				<select id="city" onchange="querys_city(this.value)">
                	<option value="">-- 请选择地区 --</option>
                	<#if list??>
						<#list list as list>
                			<option value="${list.keyname}">${list.name}</option>
                		</#list>
                	</#if>
                </select>
                <select name="target" id="target">
                	<option value="">-- 请选择目标 --</option>
                	<#if uList??>
						<#list uList as list>
                			<option value="${list.username}">${list.nickname}（${list.regions}-${list.departments}-${list.job}）</option>
                		</#list>
                	</#if>
                	<#if uList1??>
						<#list uList1 as list1>
                			<option value="${list1.username}">${list1.nickname}（${list1.regions}-${list1.departments}-${list1.job}）</option>
                		</#list>
                	</#if>
                </select>
					<p class="caption">此处选择需要接收客户资源的目标咨询师</p></td>
			</tr>
		</table>
		<div class="remark">
			<ul>
				<li><span class="title">注意事项：</span></li>
				<li>1、当输入客户姓名或者切换中心时，会自动筛选和匹配符合条件的客户资源</li>
				<li>2、若需要将指定咨询师的权限中心地址清空，只要选定该咨询师，然后取消所有勾选即可</li>
			</ul>
		</div>
		<div id="controlbar">
			<input id="btnSubmit" type="button" class="submit" value="  保存分配设置  " />
		</div>
	</div>
</body>
</html>